//
// Created by wujehy on 2020/8/23.
//

#ifndef MQTTCLIENT_COMMON_H
#define MQTTCLIENT_COMMON_H

#include <string>

class Common
{
public:
    static int64_t jenkins_hash(const char *key, size_t len);
    static std::string get_uuid();

    static int64_t getTimeMicro();

    static int64_t getTimeMilli();

    static std::string Base64Encode(const unsigned char *Data, int DataByte);

    static std::string Base64Decode(const char *Data, int DataByte, int &OutByte);

    static bool GetMd5(std::string &str_md5, const char *const buffer, size_t buffer_size);

    static bool GetPathFileNameAndFilePath(const std::string &allPath, std::string &filePath, std::string &filename, bool isUnix = true);

    static std::string StringToHex(const std::string &data);

    static std::string HexToString(const std::string &data);
};


#endif //MQTTCLIENT_COMMON_H
